.class Lcom/xingbook/c/m;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field private final synthetic a:Ljava/lang/String;

.field private final synthetic b:Lcom/xingbook/c/f;

.field private final synthetic c:Ljava/io/File;

.field private final synthetic d:F

.field private final synthetic e:Z

.field private final synthetic f:I

.field private final synthetic g:Z

.field private final synthetic h:Ljava/lang/String;

.field private final synthetic i:Landroid/os/Handler;


# direct methods
.method constructor <init>(Ljava/lang/String;Lcom/xingbook/c/f;Ljava/io/File;FZIZLjava/lang/String;Landroid/os/Handler;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/c/m;->a:Ljava/lang/String;

    iput-object p2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    iput-object p3, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    iput p4, p0, Lcom/xingbook/c/m;->d:F

    iput-boolean p5, p0, Lcom/xingbook/c/m;->e:Z

    iput p6, p0, Lcom/xingbook/c/m;->f:I

    iput-boolean p7, p0, Lcom/xingbook/c/m;->g:Z

    iput-object p8, p0, Lcom/xingbook/c/m;->h:Ljava/lang/String;

    iput-object p9, p0, Lcom/xingbook/c/m;->i:Landroid/os/Handler;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/xingbook/c/m;->a:Ljava/lang/String;

    const-string v2, "http"

    invoke-virtual {v0, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_d

    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v0}, Lcom/xingbook/c/f;->b()V

    :cond_0
    :try_start_0
    new-instance v2, Ljava/net/URL;

    iget-object v0, p0, Lcom/xingbook/c/m;->a:Ljava/lang/String;

    invoke-direct {v2, v0}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    new-instance v0, Lcom/xingbook/c/b;

    invoke-virtual {v2}, Ljava/net/URL;->openStream()Ljava/io/InputStream;

    move-result-object v2

    iget-object v3, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-direct {v0, v2, v3}, Lcom/xingbook/c/b;-><init>(Ljava/io/InputStream;Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_2

    :try_start_1
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_1

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2, v0}, Lcom/xingbook/c/f;->a(Ljava/io/InputStream;)V

    :cond_1
    invoke-static {v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_3
    .catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_12
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_11
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_10

    move-result-object v1

    if-eqz v0, :cond_2

    :try_start_2
    invoke-virtual {v0}, Lcom/xingbook/c/b;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_c

    :cond_2
    :goto_0
    if-nez v1, :cond_18

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_18

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    move-object v0, v1

    :goto_1
    if-eqz v0, :cond_4

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    if-eqz v1, :cond_3

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v1

    if-nez v1, :cond_14

    :cond_3
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    :cond_4
    :goto_2
    return-void

    :catch_0
    move-exception v0

    move-object v0, v1

    :goto_3
    :try_start_3
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_5

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2}, Lcom/xingbook/c/f;->c()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_3

    :cond_5
    if-eqz v0, :cond_6

    :try_start_4
    invoke-virtual {v0}, Lcom/xingbook/c/b;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_8

    :cond_6
    :goto_4
    if-nez v1, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    move-object v0, v1

    goto :goto_1

    :catch_1
    move-exception v0

    move-object v0, v1

    :goto_5
    :try_start_5
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_7

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2}, Lcom/xingbook/c/f;->d()V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_3

    :cond_7
    if-eqz v0, :cond_8

    :try_start_6
    invoke-virtual {v0}, Lcom/xingbook/c/b;->close()V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_9

    :cond_8
    :goto_6
    if-nez v1, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    move-object v0, v1

    goto :goto_1

    :catch_2
    move-exception v0

    move-object v2, v1

    :goto_7
    :try_start_7
    invoke-virtual {v0}, Ljava/lang/OutOfMemoryError;->printStackTrace()V

    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v0, :cond_9

    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v0}, Lcom/xingbook/c/f;->f()V
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_4

    :cond_9
    if-eqz v2, :cond_a

    :try_start_8
    invoke-virtual {v2}, Lcom/xingbook/c/b;->close()V
    :try_end_8
    .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_a

    :cond_a
    :goto_8
    if-nez v1, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    move-object v0, v1

    goto :goto_1

    :catchall_0
    move-exception v0

    move-object v2, v1

    :goto_9
    if-eqz v2, :cond_b

    :try_start_9
    invoke-virtual {v2}, Lcom/xingbook/c/b;->close()V
    :try_end_9
    .catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_b

    :cond_b
    :goto_a
    if-nez v1, :cond_c

    iget-object v1, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_c

    iget-object v1, p0, Lcom/xingbook/c/m;->c:Ljava/io/File;

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    :cond_c
    throw v0

    :cond_d
    new-instance v2, Ljava/io/File;

    iget-object v0, p0, Lcom/xingbook/c/m;->a:Ljava/lang/String;

    invoke-direct {v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_12

    :try_start_a
    new-instance v0, Ljava/io/FileInputStream;

    invoke-direct {v0, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
    :try_end_a
    .catchall {:try_start_a .. :try_end_a} :catchall_1
    .catch Ljava/io/FileNotFoundException; {:try_start_a .. :try_end_a} :catch_3
    .catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_5

    :try_start_b
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_e

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2, v0}, Lcom/xingbook/c/f;->a(Ljava/io/InputStream;)V

    :cond_e
    invoke-static {v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;
    :try_end_b
    .catchall {:try_start_b .. :try_end_b} :catchall_2
    .catch Ljava/io/FileNotFoundException; {:try_start_b .. :try_end_b} :catch_f
    .catch Ljava/io/IOException; {:try_start_b .. :try_end_b} :catch_e

    move-result-object v1

    if-eqz v0, :cond_18

    :try_start_c
    invoke-virtual {v0}, Ljava/io/FileInputStream;->close()V
    :try_end_c
    .catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_7

    move-object v0, v1

    goto/16 :goto_1

    :catch_3
    move-exception v0

    move-object v0, v1

    :goto_b
    :try_start_d
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_f

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2}, Lcom/xingbook/c/f;->e()V
    :try_end_d
    .catchall {:try_start_d .. :try_end_d} :catchall_2

    :cond_f
    if-eqz v0, :cond_13

    :try_start_e
    invoke-virtual {v0}, Ljava/io/FileInputStream;->close()V
    :try_end_e
    .catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_4

    move-object v0, v1

    goto/16 :goto_1

    :catch_4
    move-exception v0

    move-object v0, v1

    goto/16 :goto_1

    :catch_5
    move-exception v0

    move-object v0, v1

    :goto_c
    :try_start_f
    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v2, :cond_10

    iget-object v2, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v2}, Lcom/xingbook/c/f;->f()V
    :try_end_f
    .catchall {:try_start_f .. :try_end_f} :catchall_2

    :cond_10
    if-eqz v0, :cond_13

    :try_start_10
    invoke-virtual {v0}, Ljava/io/FileInputStream;->close()V
    :try_end_10
    .catch Ljava/io/IOException; {:try_start_10 .. :try_end_10} :catch_6

    move-object v0, v1

    goto/16 :goto_1

    :catch_6
    move-exception v0

    move-object v0, v1

    goto/16 :goto_1

    :catchall_1
    move-exception v0

    :goto_d
    if-eqz v1, :cond_11

    :try_start_11
    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V
    :try_end_11
    .catch Ljava/io/IOException; {:try_start_11 .. :try_end_11} :catch_d

    :cond_11
    :goto_e
    throw v0

    :catch_7
    move-exception v0

    move-object v0, v1

    goto/16 :goto_1

    :cond_12
    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    if-eqz v0, :cond_13

    iget-object v0, p0, Lcom/xingbook/c/m;->b:Lcom/xingbook/c/f;

    invoke-virtual {v0}, Lcom/xingbook/c/f;->e()V

    :cond_13
    move-object v0, v1

    goto/16 :goto_1

    :cond_14
    iget v1, p0, Lcom/xingbook/c/m;->d:F

    const/4 v2, 0x0

    cmpl-float v1, v1, v2

    if-gtz v1, :cond_15

    iget-boolean v1, p0, Lcom/xingbook/c/m;->e:Z

    if-eqz v1, :cond_16

    :cond_15
    iget v1, p0, Lcom/xingbook/c/m;->d:F

    iget v2, p0, Lcom/xingbook/c/m;->f:I

    iget-boolean v3, p0, Lcom/xingbook/c/m;->e:Z

    invoke-static {v0, v1, v2, v3}, Lcom/xingbook/c/k;->a(Landroid/graphics/Bitmap;FIZ)Landroid/graphics/Bitmap;

    move-result-object v1

    if-eqz v1, :cond_16

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    move-object v0, v1

    :cond_16
    invoke-static {}, Landroid/os/Message;->obtain()Landroid/os/Message;

    move-result-object v1

    iget-boolean v2, p0, Lcom/xingbook/c/m;->g:Z

    if-eqz v2, :cond_17

    invoke-static {}, Lcom/xingbook/c/k;->c()Ljava/util/HashMap;

    move-result-object v2

    iget-object v3, p0, Lcom/xingbook/c/m;->h:Ljava/lang/String;

    new-instance v4, Ljava/lang/ref/SoftReference;

    invoke-direct {v4, v0}, Ljava/lang/ref/SoftReference;-><init>(Ljava/lang/Object;)V

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {}, Lcom/xingbook/c/k;->c()Ljava/util/HashMap;

    move-result-object v0

    iget-object v2, p0, Lcom/xingbook/c/m;->h:Ljava/lang/String;

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/ref/SoftReference;

    invoke-virtual {v0}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v0

    iput-object v0, v1, Landroid/os/Message;->obj:Ljava/lang/Object;

    :goto_f
    iget-object v0, p0, Lcom/xingbook/c/m;->i:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto/16 :goto_2

    :cond_17
    iput-object v0, v1, Landroid/os/Message;->obj:Ljava/lang/Object;

    goto :goto_f

    :catch_8
    move-exception v0

    goto/16 :goto_4

    :catch_9
    move-exception v0

    goto/16 :goto_6

    :catch_a
    move-exception v0

    goto/16 :goto_8

    :catch_b
    move-exception v2

    goto/16 :goto_a

    :catch_c
    move-exception v0

    goto/16 :goto_0

    :catch_d
    move-exception v1

    goto :goto_e

    :catchall_2
    move-exception v1

    move-object v5, v1

    move-object v1, v0

    move-object v0, v5

    goto :goto_d

    :catch_e
    move-exception v2

    goto/16 :goto_c

    :catch_f
    move-exception v2

    goto/16 :goto_b

    :catchall_3
    move-exception v2

    move-object v5, v2

    move-object v2, v0

    move-object v0, v5

    goto/16 :goto_9

    :catchall_4
    move-exception v0

    goto/16 :goto_9

    :catch_10
    move-exception v2

    move-object v5, v2

    move-object v2, v0

    move-object v0, v5

    goto/16 :goto_7

    :catch_11
    move-exception v2

    goto/16 :goto_5

    :catch_12
    move-exception v2

    goto/16 :goto_3

    :cond_18
    move-object v0, v1

    goto/16 :goto_1
.end method
